<?php
    $img = $this->result['img'];
    $linkNext = $this->url(array('id' => $this->result['next']), $this->gid, true);
    $linkPrev = $this->url(array('id' => $this->result['prev']), $this->gid, true);
?>
{
    "imgId": <?php echo json_encode($this->id); ?>,
    "img": <?php echo json_encode($img); ?>,
    "linkNext": <?php echo json_encode($linkNext); ?>,
    "linkPrev": <?php echo json_encode($linkPrev); ?>
}